package com.wuchaooooo.service.zjutsds.config;

import javax.sql.DataSource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.transaction.support.TransactionTemplate;

@EnableTransactionManagement
public class TransactionManagerConfig{
    
//    @Bean    
//    @Autowired    //自动注入 dataSource
//    public PlatformTransactionManager txManager(DataSource dataSource1) {
//        return new DataSourceTransactionManager(dataSource1);
//    }
//    
//    @Bean
//    @Autowired
//    public TransactionTemplate getTransactionTemplate(PlatformTransactionManager transactionManager) {
//    	return new TransactionTemplate(transactionManager);
//    }
}